package v1

import "github.com/gogf/gf/v2/frame/g"

type DatabaseListReq struct {
	g.Meta `path:"/maintain/database" method:"get" tags:"maintain" sm:"数据表列表" can:"maintain.database"`
}

type DatabaseListRes struct {
	Rows []map[string]interface{} `json:"rows"`
}

type DatabaseDetailReq struct {
	g.Meta `path:"/maintain/database/show" method:"get" tags:"maintain" sm:"数据表详细" can:"maintain.database.show"`
	Table  string `json:"table" in:"query" v:"required" dc:"表名"`
}

type DatabaseDetailRes struct {
	Columns []map[string]interface{} `json:"columns" dc:"表字段信息"`
}

type DatabaseOptimizeReq struct {
	g.Meta `path:"/maintain/database/optimize" method:"post" tags:"maintain" sm:"数据表优化" can:"maintain.database.optimize"`
	Tables []string `json:"tables" v:"required|array" dc:"表名集合"`
}

type DatabaseOptimizeRes struct{}

type DatabaseRepairReq struct {
	g.Meta `path:"/maintain/database/repair" method:"post" tags:"maintain" sm:"数据表修复" can:"maintain.database.repair"`
	Tables []string `json:"tables" v:"required|array" dc:"表名集合"`
}

type DatabaseRepairRes struct{}
